﻿@using PerpetuumSoft.Knockout
@using TimeProject.WebSite.Views;

@{ Layout = "~/Views/Shared/_loginlayout.cshtml"; }

@model TimeProject.WebSite.ViewModels.LoginViewModel
@{
    var ko = Html.CreateKnockoutContext();
}

@using (ko.With(m => m.Messages))
{
    @Html.GetInfoBox(Model.Messages)
}

<form class="form-inline">
    <div id="divElement">
        <div class="row-fluid">            
            <img style="display: block;margin-left: auto;margin-right: auto" src="/Content/Images/logo.png" alt="Logo" />
            
            <div id="LoginPageWelcomeMessage">Please enter username and password to login.</div>

            <div class="span6">
                <div class="control-group">
                    <div class="controls">
                        @ko.Html.GetLoginUsernameTextBox(x => x.Username)
                    </div>
                </div>

                <div class="control-group">
                    <div class="controls">
                        @ko.Html.GetLoginPasswordTextBox(x => x.Password)
                    </div>
                </div>
                
                @ko.Html.GetCheckBox(x => x.RememberMe)
                <span style="font-size: x-small; vertical-align: sub;">Keep me logged in</span>
            </div>
        </div>
        
        <div style="height: 40px;"></div>
        
        @ko.Html.GetLoginButton("Login", "Login")
        
        <div id="LoginPageRegisterMessage">@Html.ActionLink("Register", "Register") if you don't have an account.</div>
    </div>

    @ko.Init(Model)    
</form>



